package toubiao.domain.po.business;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.springframework.stereotype.Repository;


    /**
    * @ClassName: PoPartA
    * @Description: TODO
    * @author 宁少林
    * @date 2016年9月10日
    *
    */
@Entity
@Table(name = "partA")
public class PoPartA {

	private Long id;
	
	private String name;
	
	private String province;
	
	private String city;
	
	private String fullName;
	
    /**
    * @Fields type : 联通、铁塔、移动、电信、政府、企业
    */
	private String type;
	
	/*
	 * 根据类型分为：
	1.运营商：集团、省级、地市
	2.政府：部级、省级、地市
	3.企业：大型、普通
	*/
	private String degree;
	
	public PoPartA() {
	}
	
	public PoPartA(String name, String province, String city, String fullName,
			String type, String degree) {
		super();
		this.name = name;
		this.province = province;
		this.city = city;
		this.fullName = fullName;
		this.type = type;
		this.degree = degree;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	private Set<PoProject> projectSet=new HashSet<>();
	
	
    /**
    * @Fields contractSet : 委托-合同
    */
	private Set<PoContract> entrustContractSet=new HashSet<>();

    /**
	* @Fields contractSet : 建设-合同
	*/
	private Set<PoContract> constructionContractSet=new HashSet<>();
	
	private Set<PoContact> contactSet=new HashSet<>();
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDegree() {
		return degree;
	}

	public void setDegree(String degree) {
		this.degree = degree;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "partA")
	public Set<PoProject> getProjectSet() {
		return projectSet;
	}

	public void setProjectSet(Set<PoProject> projectSet) {
		this.projectSet = projectSet;
	}

	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "entrustPartA")
	public Set<PoContract> getEntrustContractSet() {
		return entrustContractSet;
	}

	public void setEntrustContractSet(Set<PoContract> entrustContractSet) {
		this.entrustContractSet = entrustContractSet;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "constructionPartA")
	public Set<PoContract> getConstructionContractSet() {
		return constructionContractSet;
	}

	public void setConstructionContractSet(Set<PoContract> constructionContractSet) {
		this.constructionContractSet = constructionContractSet;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "partA")
	public Set<PoContact> getContactSet() {
		return contactSet;
	}

	public void setContactSet(Set<PoContact> contactSet) {
		this.contactSet = contactSet;
	}

}
